#include <bits/stdc++.h>

using namespace std;
class Solution
{
public:
    vector<int> singleNumber(vector<int> &nums)
    {
        int tmp = nums[0];
        for (int i = 1; i < nums.size(); ++i)
        {
            tmp ^= nums[i];
        }
        tmp = tmp == INT32_MIN ? tmp : tmp & -tmp;
        int type1 = 0, type2 = 0;
        for (auto x : nums)
        {
            if (x & tmp)
            {
                type1 ^= x;
            }
            else
            {
                type2 ^= x;
            }
        }
        vector<int> ret;
        ret.push_back(type1);
        ret.push_back(type2);
        return ret;
    }
};